package com.qdxwx.models.course;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public class Course implements Serializable {

    private static final long serialVersionUID = -817817170698508701L;

    private int courseId;
    //课程名称
    private String courseName;
    //频道Id
    private int channelId;
    //课程专业ID
    private int subjectId;
    //课程专业名称
    private String subjectName;
    //课程分类Id
    private int categoryId;
    //课程分类名称
    private String categoryName;
    private Integer sourcePrice;//课程原价格（只显示）
    private Integer price;//课程销售价格（实际支付价格）设置为0则可免费观看
    private String intro;//课程简介
    private String cover;//课程封面
    private String context;//课程详情
    private int lessonNum;//课时
    private int totalDurations;//课程章节总时长（单位秒）

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate expireDate;//失效日期

    private String sellType;//课程类型：COURSE(课程) LIVE(直播)

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime liveBeginTime;//直播开始时间
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime liveEndTime;//直播结束时间

    private List<CourseNode> courseNodeList;//课程下的章节list

    private long teacherId;

    //1 正常　２　下架   3删除
    private int isAvailable;

    private int buyCount;//销售数量
    private int viewCount;//浏览数量

    private Integer isTop;

    private Integer isElite;

    //bookId
    private int bookId;
    //userId
    private long userId;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addTime;//课程添加时间

    public int getBookId() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    public Integer getIsTop() {
        return isTop;
    }

    public void setIsTop(Integer isTop) {
        this.isTop = isTop;
    }

    public Integer getIsElite() {
        return isElite;
    }

    public void setIsElite(Integer isElite) {
        this.isElite = isElite;
    }

    public int getCourseId() {
        return courseId;
    }

    public void setCourseId(int courseId) {
        this.courseId = courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public int getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(int subjectId) {
        this.subjectId = subjectId;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getSourcePrice() {
        return sourcePrice;
    }

    public void setSourcePrice(Integer sourcePrice) {
        this.sourcePrice = sourcePrice;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public int getLessonNum() {
        return lessonNum;
    }

    public void setLessonNum(int lessonNum) {
        this.lessonNum = lessonNum;
    }

    public int getTotalDurations() {
        return totalDurations;
    }

    public void setTotalDurations(int totalDurations) {
        this.totalDurations = totalDurations;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public int getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(int buyCount) {
        this.buyCount = buyCount;
    }

    public int getViewCount() {
        return viewCount;
    }

    public void setViewCount(int viewCount) {
        this.viewCount = viewCount;
    }

    public LocalDate getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(LocalDate expireDate) {
        this.expireDate = expireDate;
    }

    public String getSellType() {
        return sellType;
    }

    public void setSellType(String sellType) {
        this.sellType = sellType;
    }

    public LocalDateTime getLiveBeginTime() {
        return liveBeginTime;
    }

    public void setLiveBeginTime(LocalDateTime liveBeginTime) {
        this.liveBeginTime = liveBeginTime;
    }

    public LocalDateTime getLiveEndTime() {
        return liveEndTime;
    }

    public void setLiveEndTime(LocalDateTime liveEndTime) {
        this.liveEndTime = liveEndTime;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public long getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(long teacherId) {
        this.teacherId = teacherId;
    }

    public int getIsAvailable() {
        return isAvailable;
    }

    public void setIsAvailable(int isAvailable) {
        this.isAvailable = isAvailable;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public LocalDateTime getAddTime() {
        return addTime;
    }

    public void setAddTime(LocalDateTime addTime) {
        this.addTime = addTime;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public List<CourseNode> getCourseNodeList() {
        return courseNodeList;
    }

    public void setCourseNodeList(List<CourseNode> courseNodeList) {
        this.courseNodeList = courseNodeList;
    }

    @Override
    public String toString() {
        return "Course{" +
                "courseId=" + courseId +
                "bookId=" + bookId +
                "userId=" + userId +
                ", courseName='" + courseName + '\'' +
                ", isAvailable=" + isAvailable +
                ", categoryId=" + categoryId +
                ", addTime=" + addTime +
                ", sourcePrice=" + sourcePrice +
                ", price=" + price +
                ", intro='" + intro + '\'' +
                ", context='" + context + '\'' +
                ", lessonNum=" + lessonNum +
                ", totalDurations=" + totalDurations +
                ", logo='" + cover + '\'' +
                ", updateTime=" + updateTime +
                ", buyCount=" + buyCount +
                ", viewCount=" + viewCount +
                ", expireDate=" + expireDate +
                ", sellType='" + sellType + '\'' +
                ", liveBeginTime=" + liveBeginTime +
                ", liveEndTime=" + liveEndTime +
                ", categoryName='" + categoryName + '\'' +
                ", teacherId=" + teacherId +
                ", isTop=" + isTop +
                ", isElite=" + isElite +
                '}';
    }
}
